package com.jason.hadoop.bean;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class WordOrderBean implements Writable {

    private Integer order;

    private Integer num;

    public WordOrderBean() {}

    @Override
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeInt(order);
        dataOutput.writeInt(num);
    }

    @Override
    public void readFields(DataInput dataInput) throws IOException {
        this.order = dataInput.readInt();
        this.num = dataInput.readInt();
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    @Override
    public String toString() {
        return order + "  " + num;
    }
}
